﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using Smart.Windows.Navigation;
using Smart.Windows.Navigation.Parameter;

namespace NavigationSampleApp.View
{
    [View(Views.DataDetailNew)]
    [View(Views.DataDetailEdit)]
    public partial class DataDetailView : AppViewBase
    {
        [ViewParameter(Direction.Import)]
        protected string selectedId;

        /// <summary>
        /// 
        /// </summary>
        public DataDetailView()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        public override void OnViewOpen(ViewForwardEventArgs args)
        {
            // ファンクションキー
            FunctionCotrol.UpdateFunctionKeys( null );

            // 表示
            if( (Views)args.ViewId == Views.DataDetailEdit )
            {
                this.lblMessage.Text = "編集データID " + this.selectedId;
            }
            else
            {
                this.lblMessage.Text = "新規作成";
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public override void OnButtonExit()
        {
            Navigator.Pop();
        }
    }
}
